Page({
    data: {
        active: 0,
    },
    onChange(event) {
        this.setData({ active: parseInt(event.detail.name) })
        wx.showToast({
            title: `切换到标签 ${event.detail.name}`,
            icon: 'none',
        });
    },
    onLoad: function(options) {
        this.setData({ active: parseInt(options.active) })
    }
})